import request from '@/utils/request';

// 获取项目教学资料
function getteaching(id) {
  return request({
    url: '/project/material',
    method: 'GET',
    params: {
      id
    }

    // emulateJSON: true

  });
}

// 删除教学资料
function delteaching(id) {
  return request({
    url: '/project/material',
    method: 'DELETE',
    params: {
      id
    }

    // emulateJSON: true

  });
}

// 插入与修改教学资料
function material(data) {
  return request({
    url: '/project/material',
    method: 'POST',
    data
    // emulateJSON: true
  });
}

// 上传教学视频
function upTeachingData(data) {
  return request({
    url: '/file/upload',
    method: 'POST',
    data
    // emulateJSON: true
  });
}

// 修改内容
function editData(data) {
  return request({
    url: '/project/update/material',
    method: 'POST',
    data
    // emulateJSON: true
  });
}
// 修改资料顺序
function modifyOrder(id, type) {
  return request({
    url: '/project/order',
    method: 'GET',
    params: {
      id, type
    }
    // emulateJSON: true
  });
}

export { getteaching, delteaching, material, upTeachingData, modifyOrder, editData };
